<%--
  Created by IntelliJ IDEA.
  User: student
  Date: 2019/9/11
  Time: 8:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" isELIgnored="false" %>
<%
    String path = request.getContextPath();
    String basepath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <title>Title</title>
    <base href="<%=basepath %>"/>
    <link rel="stylesheet" href="static/layui/css/layui.css">
    <style>

    </style>
</head>
<body>
<%--<%=request.getParameter("username") %>--%>

<%--hello ！！！！2019年9月16日 17:40:27--%>

集合的长度是：${users.size()}
<hr>
1.${sessionScope.name}
<hr>
2.${session.name}
<hr>
3.<%=session.getAttribute("name")%>
<hr>
<%--没有分号代码要报错--%>
4.<%session.getAttribute("name");%>


<hr>
<table class="layui-hide" id="userList"></table>


<script src="static/layui/layui.all.js"></script>
<script>
    layui.use(['table','form','jquery'], function(table, form, $){
        var $ = layui.jquery, table = layui.table, form = layui.form;
        table.render({
            elem: '#userList'
            ,url:'user/list'
            ,cellMinWidth: 180 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            ,cols: [[
                {type:'checkbox'}
                ,{field:'username', width:180, title: '用户名'}
                ,{field:'password', width:280, title: '密码222222', sort: true}
            ]]
            ,page: true
            ,parseData: function(res){ //res 即为原始返回的数据
                console.log(res);
            return {
                "code": res.code, //解析接口状态
                "msg": res.msg, //解析提示文本
                "count": res.count, //解析数据长度
                "data": res.data //解析数据列表
            };
        }
        });
    });
</script>
</body>
</html>
